package com.hermit.qmst.UI.activity;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.hermit.qmst.MainActivity;
import com.hermit.qmst.R;

public class SysMsgInterstitial extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sysmsg_tip);
		Button button = (Button) findViewById(R.id.notify_app);
	    button.setOnClickListener(new OnClickListener() {
	                public void onClick(View v) {
	                    switchToApp();
	                }
	    		});
	    Button button2 = (Button)findViewById(R.id.notify_cancel);
	    button2.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
				
			}
		});
	    TextView textView = (TextView)findViewById(R.id.tv_sys_msg);
	    textView.setText(getIntent().getStringExtra("SYS_MSG").toString());
	}
	
	 /**
     * Perform a switch to the app.  A new activity stack is started, replacing
     * whatever is currently running, and this activity is finished.
     */
    void switchToApp() {
        
        Intent _Intent = new Intent(SysMsgInterstitial.this, MainActivity.class);
        startActivity(_Intent);
        finish();
    }

}
